{include file="public/layout" /}

<body class="bodystyle" style="cursor: default; -moz-user-select: inherit;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
{include file="canal/left" /}
<div class="page" style="min-width:auto;margin-left:100px;">
    <div class="flexigrid">
        <form class="form-horizontal" id="postForm" action="{:url('Canal/regset')}" method="post">
            <div class="hDiv htitx">
                <div class="hDivBox">
                    <table cellspacing="0" cellpadding="0" style="width: 100%">
                        <thead>
                        <tr>
                            <th class="sign w10" axis="col0">
                                <div class="tc"></div>
                            </th>
                            <th abbr="article_title" axis="col3" class="w10">
                                <div class="tc">授权登录</div>
                            </th>
                            <th abbr="ac_id" axis="col4">
                                <div class=""></div>
                            </th>
                        </tr>
                        </thead>
                    </table>
                </div>
            </div>
            <div id="" class="explanation mt10">
                <ul>
                    <li>用户访问商城时，是否需要授权/登录后才可进行浏览商城。</li>
                </ul>
            </div>
            <div class="ncap-form-default">
                <dl class="row">
                    <dt class="tit">
                        <label for="uname">强制授权登录</label>
                    </dt>
                    <dd class="opt">
                        <label class="curpoin">
                            <input type="radio" name="users[users_force_login]" value="1" {if condition="!empty($info.users_force_login)"}checked="checked"{/if}/>开启
                        </label>
                        &nbsp;&nbsp;&nbsp;
                        <label class="curpoin">
                            <input type="radio" name="users[users_force_login]" value="0" {if condition="empty($info.users_force_login)"}checked="checked"{/if}/>关闭
                        </label>
                        <p class="notic2">开启强制授权登录时，用户访问商城必须授权后才可进行商城浏览及下单操作。</p>
                        <p class="notic2">系统默认关闭强制授权登录，当触发加入购物车、立即购买、提交表单、领取优惠券时需要获取用户登录信息。</p>
                    </dd>
                </dl>
    
                <!-- <dl class="row">
                    <dt class="tit">
                        <label for="uname">手机浏览器H5 登录方式：</label>
                    </dt>
                    <dd class="opt">
                        <label class="curpoin">
                            <input type="radio" name="users[users_open_reg]" value="0" {if condition="!isset($info.users_open_reg) || empty($info.users_open_reg)"}checked="checked"{/if}/>短信验证码登录
                        </label>
                        &nbsp;&nbsp;&nbsp;
                        <label class="curpoin">
                            <input type="radio" name="users[users_open_reg]" value="1" {if condition="$info.users_open_reg == 1"}checked="checked"{/if}/>账号密码登录
                        </label>
                        <p class="notic2">手机浏览器H5用户登录时默认登录方式</p>
                    </dd>
                </dl> -->
            </div>
            <!-- <div class="hDiv htitx">
                <div class="hDivBox">
                    <table cellspacing="0" cellpadding="0" style="width: 100%">
                        <thead>
                        <tr>
                            <th class="sign w10" axis="col0">
                                <div class="tc"></div>
                            </th>
                            <th abbr="article_title" axis="col3" class="w10">
                                <div class="tc">注册规则</div>
                            </th>
                            <th abbr="ac_id" axis="col4">
                                <div class=""></div>
                            </th>
                        </tr>
                        </thead>
                    </table>
                </div>
            </div> -->
            <!-- <div id="" class="explanation mt10">
                <ul>
                    <li>买家通过微信授权登录后，引导买家绑定手机号，识别买家唯一身份，解决买家在微信（公众号和小程序）等不同渠道账号不同的问题；需要开启消息通知功能。</li>
                </ul>
            </div> -->
            <!-- <div class="ncap-form-default">
                <dl class="row">
                    <dt class="tit">
                        <label for="users_login_expiretime">绑定手机号</label>
                    </dt>
                    <dd class="opt">
                        <label class="curpoin">
                            <input type="radio" name="users[users_login_jump_type]" value="1" onclick="$('#login_jump_url_dl').hide();" {if condition="!empty($info.users_login_jump_type) && $info.users_login_jump_type == 1"}checked="checked"{/if}/>强制绑定
                        </label>
                        
                        &nbsp;&nbsp;&nbsp;
                        <label class="curpoin">
                            <input type="radio" name="users[users_login_jump_type]" value="2" onclick="$('#login_jump_url_dl').hide();" {if condition="!isset($info.users_login_jump_type) || $info.users_login_jump_type == 2"}checked="checked"{/if}/>手动绑定
                        </label>
                        <p class="notic"></p>
                    </dd>
                </dl>
            </div> -->
    
            <div class="ncap-form-default">
                <dl class="row">
                    <div class="bot">
                        <a href="JavaScript:void(0);" onclick="usersset();" class="ncap-btn-big ncap-btn-green w60" id="submitBtn">保存</a>
                    </div>
                </dl>
            </div>
    
        </form>
    </div>
</div>

<script type="text/javascript">
    function usersset(){
        layer_loading('正在处理');
        $.ajax({
            type : 'post',
            url : "{:url('Canal/regset', ['_ajax'=>1])}",
            data : $('#postForm').serialize(),
            dataType : 'json',
            success : function(res){
                if(res.code == 1){
                    layer.closeAll();
                    layer.msg(res.msg, {shade: layer_shade, time: 1000}, function(){
                        window.location.reload();
                    });
                }else{
                    layer.closeAll();
                    showErrorAlert(res.msg);
                }
            },
            error: function(e){
                layer.closeAll();
                showErrorAlert(e.responseText);
            }
        });
    }
</script>

{include file="public/footer" /}